<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TestKontrole2.RevizijskiCiklus>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Uzorci
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Uzorci</h2>
            <% 
                int j = -1;
        foreach (var item in Model.getKontrole()) {
            j++;
             %>

                <table border="0" width="30%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td colspan="3" align="center">
                            <%= item.OpisKontrole.ToString() %>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            Id elementa
                        </td>
                        <td align="center">
                            Stanje
                        </td>
                        <td align="center">
                            Komentar revizora
                        </td>
                    </tr>
                    <%  for (int i = 0; i < item.getUzorak().getAllElement().Count; i++) {
                      %>
                    <tr>
                        <td align="center">
                            <%= item.getUzorak().getAllElement()[i].getID().ToString() %>
                        </td>
                        <td align="center">
                            <select id="<%= i %>">
                                <% foreach (var tip in (IEnumerable<SelectListItem>)ViewData["stanja"])
	                                {%>
                                <option value="<%= tip %>"> <%= tip.Text %> </option>
                                <%	} %>
                            </select>
                        </td>
                        <td align="center">
                            <%= Html.TextArea("komentarRev"+j.ToString(), "", 2, 20, null) %>
                        </td>
                    </tr>
                    <%} %>
                </table>
            <%} %>

    <% using (Html.BeginForm("Finish", "TestKontrole", FormMethod.Post)) {%>
    <%= Html.Hidden("revCik",Model.Naziv) %>
    <input type="submit" value="Odluka" />
    <% } %>
</asp:Content>
